java get current directory

51

java get current directory -

System.getProperty("user.dir"));

get file path java -

File file = new File("yourfileName");
String path = file.getAbsolutePath();

python get parent directory -

from pathlib import Path
Path('C:\Program Files').parent

Comments

Submit
0 Comments